{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "76532a3a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "1bbc7816",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[  5,  18,  21],\n",
       "        [ 41,  20, 129],\n",
       "        [  3,  35,  12],\n",
       "        [ 77, 111, 142],\n",
       "        [ 67,  55,   0],\n",
       "        [117,  60, 112],\n",
       "        [120,  47,   7],\n",
       "        [131,  41, 132],\n",
       "        [147,   9,  36],\n",
       "        [142,  53,  27],\n",
       "        [102, 104,  75],\n",
       "        [  1, 105,  11],\n",
       "        [ 41,  52,  93],\n",
       "        [ 19,  79,  31],\n",
       "        [ 16, 106,  42],\n",
       "        [  7,  78,  29],\n",
       "        [ 41,  65,  67],\n",
       "        [  4,  56,  66],\n",
       "        [ 65,  65,  84],\n",
       "        [135,  82,  52],\n",
       "        [ 57,   6,  90],\n",
       "        [ 53, 116, 127],\n",
       "        [ 35,  41,  93],\n",
       "        [102,  94,  79],\n",
       "        [ 71,  23, 136],\n",
       "        [ 80, 100, 149],\n",
       "        [122, 102,  24],\n",
       "        [ 27,  48, 147],\n",
       "        [  2,  40,  68],\n",
       "        [ 35, 126,  10],\n",
       "        [ 13,   2,  11],\n",
       "        [ 21,   4,  97],\n",
       "        [144,  13, 106],\n",
       "        [ 33, 147, 129],\n",
       "        [ 16,  34, 145],\n",
       "        [ 15,   6,  62],\n",
       "        [ 60,  12,  34],\n",
       "        [ 70,  81,  95],\n",
       "        [150,   9, 121],\n",
       "        [ 50,   0,  26],\n",
       "        [131, 137,  65],\n",
       "        [ 62,  82, 141],\n",
       "        [107,  91, 120],\n",
       "        [ 38, 109,  51],\n",
       "        [ 27, 120, 105],\n",
       "        [129, 101, 135],\n",
       "        [ 35,  17,  72],\n",
       "        [ 82, 108, 107],\n",
       "        [103, 146, 106],\n",
       "        [ 77,  90, 119]],\n",
       "\n",
       "       [[ 62, 100, 138],\n",
       "        [  4,  60,  55],\n",
       "        [110, 115,  99],\n",
       "        [ 46, 137,  39],\n",
       "        [ 20, 125,  53],\n",
       "        [100, 102,  54],\n",
       "        [ 82,  56,  41],\n",
       "        [133,  97,  64],\n",
       "        [ 15,   8,  49],\n",
       "        [143,   4,  13],\n",
       "        [  0,  49, 130],\n",
       "        [ 75,  81,  27],\n",
       "        [ 41, 110,  75],\n",
       "        [137, 118,  26],\n",
       "        [  5,  30, 127],\n",
       "        [ 38,  21, 130],\n",
       "        [  4,  40, 133],\n",
       "        [ 44, 141,   9],\n",
       "        [  6, 128,  57],\n",
       "        [ 91,   2,   5],\n",
       "        [  2,   9,  38],\n",
       "        [ 11,   4,  90],\n",
       "        [ 28,  86, 144],\n",
       "        [121,  90,  98],\n",
       "        [ 51,  66,  28],\n",
       "        [107,  27,  93],\n",
       "        [126,  15,  59],\n",
       "        [ 28, 124, 103],\n",
       "        [103,  66,  85],\n",
       "        [140, 109,  53],\n",
       "        [135, 143,  17],\n",
       "        [ 67, 140,  86],\n",
       "        [ 61,  42,  61],\n",
       "        [116,  84,  50],\n",
       "        [  6, 149,  44],\n",
       "        [125, 149,  12],\n",
       "        [ 92,  35,  55],\n",
       "        [111, 107,  30],\n",
       "        [ 72,  65,  14],\n",
       "        [ 59,  86,  15],\n",
       "        [100,  83,  36],\n",
       "        [130,   6,  40],\n",
       "        [ 62,  70,  70],\n",
       "        [ 70,  27,  90],\n",
       "        [147, 140,  82],\n",
       "        [103, 103, 123],\n",
       "        [ 80, 102,  48],\n",
       "        [122,  39, 115],\n",
       "        [122,  25,  28],\n",
       "        [138,   2,  73]],\n",
       "\n",
       "       [[ 49, 113,  62],\n",
       "        [133,  42, 107],\n",
       "        [118,  72,  46],\n",
       "        [146,  85,  90],\n",
       "        [ 98, 126,  11],\n",
       "        [ 77, 137,  85],\n",
       "        [ 48, 111,  35],\n",
       "        [121,  80,  44],\n",
       "        [ 14,  12,  14],\n",
       "        [131,  88, 136],\n",
       "        [ 86,  82,  82],\n",
       "        [ 69,  28,  35],\n",
       "        [141,   8, 133],\n",
       "        [ 74, 123, 100],\n",
       "        [ 46, 124, 119],\n",
       "        [116, 144,  71],\n",
       "        [101, 109, 137],\n",
       "        [  3, 138,  37],\n",
       "        [ 74,  96,  98],\n",
       "        [ 34,  39, 108],\n",
       "        [ 56, 137, 106],\n",
       "        [ 37,  53,  14],\n",
       "        [141,  67,  72],\n",
       "        [ 49,  49, 123],\n",
       "        [ 49,   7, 134],\n",
       "        [ 75,  14,  45],\n",
       "        [ 43, 129,  57],\n",
       "        [117, 116,  16],\n",
       "        [ 98,   7,  81],\n",
       "        [ 38,  92,  99],\n",
       "        [101,   6, 130],\n",
       "        [ 68,  52,  48],\n",
       "        [ 43,  85,  37],\n",
       "        [122,  74,  19],\n",
       "        [105,  32, 133],\n",
       "        [ 52, 139,   5],\n",
       "        [133, 115,  70],\n",
       "        [ 24, 128,  76],\n",
       "        [  8,  60, 122],\n",
       "        [ 92,   3,  50],\n",
       "        [ 93,  77, 104],\n",
       "        [ 27,  27,  45],\n",
       "        [ 73,  66,  46],\n",
       "        [145,  39,  18],\n",
       "        [ 85,  66,  41],\n",
       "        [ 30,  90,  66],\n",
       "        [115,  55, 100],\n",
       "        [130, 121,  84],\n",
       "        [ 38,  85,  26],\n",
       "        [117,  73,  96]],\n",
       "\n",
       "       [[114, 148,  75],\n",
       "        [150,   9, 127],\n",
       "        [ 68,  26, 102],\n",
       "        [ 20, 137,  96],\n",
       "        [ 36, 126,  24],\n",
       "        [ 95, 104,  26],\n",
       "        [111, 125,  61],\n",
       "        [ 53, 108, 101],\n",
       "        [ 71,  37,  66],\n",
       "        [ 83, 150, 107],\n",
       "        [ 56,  33, 101],\n",
       "        [ 92,  14,  79],\n",
       "        [ 11,  29,  76],\n",
       "        [ 42,  49,  62],\n",
       "        [135,  89, 135],\n",
       "        [ 10, 131,  70],\n",
       "        [ 49,   1,  20],\n",
       "        [133, 147,  97],\n",
       "        [123,  31,  20],\n",
       "        [ 33, 116,  98],\n",
       "        [ 85,  91, 130],\n",
       "        [  0,  63, 147],\n",
       "        [112,  76, 115],\n",
       "        [ 18,  82, 110],\n",
       "        [ 62,  67,  28],\n",
       "        [133,  45, 138],\n",
       "        [111, 107,  19],\n",
       "        [109,  54, 131],\n",
       "        [142,  10, 113],\n",
       "        [ 67,  14, 146],\n",
       "        [ 78, 133, 110],\n",
       "        [ 53, 103, 150],\n",
       "        [ 71,  15,  11],\n",
       "        [114,  12,  94],\n",
       "        [ 99,   4,  46],\n",
       "        [ 45,  86,  98],\n",
       "        [ 39,  18,  52],\n",
       "        [125,  99,  94],\n",
       "        [ 45,  69,  97],\n",
       "        [ 68, 145,  50],\n",
       "        [104,  25, 114],\n",
       "        [135,  30,  59],\n",
       "        [ 79, 109,  14],\n",
       "        [141,   3,  14],\n",
       "        [ 48,  36, 131],\n",
       "        [ 12,  79,  35],\n",
       "        [ 91,  92,   3],\n",
       "        [ 78,  70,  98],\n",
       "        [122, 108,  16],\n",
       "        [ 80,  15,  68]],\n",
       "\n",
       "       [[ 52, 150, 137],\n",
       "        [122, 101,  22],\n",
       "        [ 74,  14,  25],\n",
       "        [ 18,   0, 146],\n",
       "        [106, 125,  49],\n",
       "        [ 96,  16, 124],\n",
       "        [129,  95, 106],\n",
       "        [ 14,  67,  38],\n",
       "        [ 92,  31,  75],\n",
       "        [ 28,  23,  73],\n",
       "        [130,   7, 145],\n",
       "        [141,  99,  72],\n",
       "        [ 92,  74, 101],\n",
       "        [ 84,  60,  36],\n",
       "        [ 10,   7, 124],\n",
       "        [ 11,  28,  46],\n",
       "        [ 65,  32,  50],\n",
       "        [ 73,   0, 106],\n",
       "        [ 39,  66, 145],\n",
       "        [ 34,  37, 126],\n",
       "        [ 59, 120,  69],\n",
       "        [136,  26,  76],\n",
       "        [132,  87, 125],\n",
       "        [144, 108,  83],\n",
       "        [ 35,   9,  12],\n",
       "        [ 23, 100, 130],\n",
       "        [ 62, 112,  17],\n",
       "        [ 83,  94, 139],\n",
       "        [146,  44,  57],\n",
       "        [ 85,  55,  88],\n",
       "        [ 43,  97,  20],\n",
       "        [ 82,  11,  54],\n",
       "        [ 73,  74,  93],\n",
       "        [  3,  24,  38],\n",
       "        [150, 125,  29],\n",
       "        [122,  79, 131],\n",
       "        [ 24,  80, 100],\n",
       "        [ 28, 101,  80],\n",
       "        [ 19, 116,  74],\n",
       "        [102,  78,  47],\n",
       "        [ 38, 117,  27],\n",
       "        [ 70,  44,  55],\n",
       "        [108,  95,  74],\n",
       "        [116, 107, 117],\n",
       "        [  1, 141,  65],\n",
       "        [ 23, 139,   1],\n",
       "        [ 47, 110,  62],\n",
       "        [ 58,  33,  85],\n",
       "        [ 17,  65, 135],\n",
       "        [ 27,  11, 139]],\n",
       "\n",
       "       [[ 26,  61,  76],\n",
       "        [ 75, 128,  33],\n",
       "        [ 63,  89,  49],\n",
       "        [105,  82,  39],\n",
       "        [ 51,  33, 101],\n",
       "        [ 36,  91, 134],\n",
       "        [ 25,   5,  11],\n",
       "        [ 34, 136,  41],\n",
       "        [ 95,  80,  95],\n",
       "        [ 51,   9,   4],\n",
       "        [142, 101,  47],\n",
       "        [131,   9,  69],\n",
       "        [104,  28, 106],\n",
       "        [ 12,  64,  66],\n",
       "        [ 58, 111,  88],\n",
       "        [  4,   9,  69],\n",
       "        [141,   7,  41],\n",
       "        [ 95, 120,  12],\n",
       "        [137, 114, 110],\n",
       "        [ 93,  28,  81],\n",
       "        [118,  48,  36],\n",
       "        [ 70, 129, 137],\n",
       "        [ 85,  93,   3],\n",
       "        [ 37,  99, 146],\n",
       "        [109,  33,  71],\n",
       "        [136,  33,  79],\n",
       "        [ 51, 149, 125],\n",
       "        [ 26,   1,  69],\n",
       "        [101,  39,  31],\n",
       "        [ 36,  59,   8],\n",
       "        [136,   6, 111],\n",
       "        [133,  45, 126],\n",
       "        [ 70,  95,  79],\n",
       "        [ 57,  17,  57],\n",
       "        [129,  96,  91],\n",
       "        [ 14,   8,  18],\n",
       "        [ 56,  69, 105],\n",
       "        [101,  30,  70],\n",
       "        [ 77, 123, 149],\n",
       "        [150, 103,  90],\n",
       "        [ 11, 101, 133],\n",
       "        [ 37,  17, 149],\n",
       "        [112,  59, 145],\n",
       "        [ 35, 112,  56],\n",
       "        [140, 149,  81],\n",
       "        [ 60, 144,  36],\n",
       "        [ 36,  42,  96],\n",
       "        [136, 109,   8],\n",
       "        [106,  58,  49],\n",
       "        [118, 127,  12]]])"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 生成6个班50名学生的成绩\n",
    "a = np.random.randint(0,151,size = (6,50,3))\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "29069669",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5,  18,  21],\n",
       "       [ 41,  20, 129],\n",
       "       [  3,  35,  12],\n",
       "       [ 77, 111, 142],\n",
       "       [ 67,  55,   0],\n",
       "       [117,  60, 112],\n",
       "       [120,  47,   7],\n",
       "       [131,  41, 132],\n",
       "       [147,   9,  36],\n",
       "       [142,  53,  27],\n",
       "       [102, 104,  75],\n",
       "       [  1, 105,  11],\n",
       "       [ 41,  52,  93],\n",
       "       [ 19,  79,  31],\n",
       "       [ 16, 106,  42],\n",
       "       [  7,  78,  29],\n",
       "       [ 41,  65,  67],\n",
       "       [  4,  56,  66],\n",
       "       [ 65,  65,  84],\n",
       "       [135,  82,  52],\n",
       "       [ 57,   6,  90],\n",
       "       [ 53, 116, 127],\n",
       "       [ 35,  41,  93],\n",
       "       [102,  94,  79],\n",
       "       [ 71,  23, 136],\n",
       "       [ 80, 100, 149],\n",
       "       [122, 102,  24],\n",
       "       [ 27,  48, 147],\n",
       "       [  2,  40,  68],\n",
       "       [ 35, 126,  10],\n",
       "       [ 13,   2,  11],\n",
       "       [ 21,   4,  97],\n",
       "       [144,  13, 106],\n",
       "       [ 33, 147, 129],\n",
       "       [ 16,  34, 145],\n",
       "       [ 15,   6,  62],\n",
       "       [ 60,  12,  34],\n",
       "       [ 70,  81,  95],\n",
       "       [150,   9, 121],\n",
       "       [ 50,   0,  26],\n",
       "       [131, 137,  65],\n",
       "       [ 62,  82, 141],\n",
       "       [107,  91, 120],\n",
       "       [ 38, 109,  51],\n",
       "       [ 27, 120, 105],\n",
       "       [129, 101, 135],\n",
       "       [ 35,  17,  72],\n",
       "       [ 82, 108, 107],\n",
       "       [103, 146, 106],\n",
       "       [ 77,  90, 119],\n",
       "       [ 62, 100, 138],\n",
       "       [  4,  60,  55],\n",
       "       [110, 115,  99],\n",
       "       [ 46, 137,  39],\n",
       "       [ 20, 125,  53],\n",
       "       [100, 102,  54],\n",
       "       [ 82,  56,  41],\n",
       "       [133,  97,  64],\n",
       "       [ 15,   8,  49],\n",
       "       [143,   4,  13],\n",
       "       [  0,  49, 130],\n",
       "       [ 75,  81,  27],\n",
       "       [ 41, 110,  75],\n",
       "       [137, 118,  26],\n",
       "       [  5,  30, 127],\n",
       "       [ 38,  21, 130],\n",
       "       [  4,  40, 133],\n",
       "       [ 44, 141,   9],\n",
       "       [  6, 128,  57],\n",
       "       [ 91,   2,   5],\n",
       "       [  2,   9,  38],\n",
       "       [ 11,   4,  90],\n",
       "       [ 28,  86, 144],\n",
       "       [121,  90,  98],\n",
       "       [ 51,  66,  28],\n",
       "       [107,  27,  93],\n",
       "       [126,  15,  59],\n",
       "       [ 28, 124, 103],\n",
       "       [103,  66,  85],\n",
       "       [140, 109,  53],\n",
       "       [135, 143,  17],\n",
       "       [ 67, 140,  86],\n",
       "       [ 61,  42,  61],\n",
       "       [116,  84,  50],\n",
       "       [  6, 149,  44],\n",
       "       [125, 149,  12],\n",
       "       [ 92,  35,  55],\n",
       "       [111, 107,  30],\n",
       "       [ 72,  65,  14],\n",
       "       [ 59,  86,  15],\n",
       "       [100,  83,  36],\n",
       "       [130,   6,  40],\n",
       "       [ 62,  70,  70],\n",
       "       [ 70,  27,  90],\n",
       "       [147, 140,  82],\n",
       "       [103, 103, 123],\n",
       "       [ 80, 102,  48],\n",
       "       [122,  39, 115],\n",
       "       [122,  25,  28],\n",
       "       [138,   2,  73],\n",
       "       [ 49, 113,  62],\n",
       "       [133,  42, 107],\n",
       "       [118,  72,  46],\n",
       "       [146,  85,  90],\n",
       "       [ 98, 126,  11],\n",
       "       [ 77, 137,  85],\n",
       "       [ 48, 111,  35],\n",
       "       [121,  80,  44],\n",
       "       [ 14,  12,  14],\n",
       "       [131,  88, 136],\n",
       "       [ 86,  82,  82],\n",
       "       [ 69,  28,  35],\n",
       "       [141,   8, 133],\n",
       "       [ 74, 123, 100],\n",
       "       [ 46, 124, 119],\n",
       "       [116, 144,  71],\n",
       "       [101, 109, 137],\n",
       "       [  3, 138,  37],\n",
       "       [ 74,  96,  98],\n",
       "       [ 34,  39, 108],\n",
       "       [ 56, 137, 106],\n",
       "       [ 37,  53,  14],\n",
       "       [141,  67,  72],\n",
       "       [ 49,  49, 123],\n",
       "       [ 49,   7, 134],\n",
       "       [ 75,  14,  45],\n",
       "       [ 43, 129,  57],\n",
       "       [117, 116,  16],\n",
       "       [ 98,   7,  81],\n",
       "       [ 38,  92,  99],\n",
       "       [101,   6, 130],\n",
       "       [ 68,  52,  48],\n",
       "       [ 43,  85,  37],\n",
       "       [122,  74,  19],\n",
       "       [105,  32, 133],\n",
       "       [ 52, 139,   5],\n",
       "       [133, 115,  70],\n",
       "       [ 24, 128,  76],\n",
       "       [  8,  60, 122],\n",
       "       [ 92,   3,  50],\n",
       "       [ 93,  77, 104],\n",
       "       [ 27,  27,  45],\n",
       "       [ 73,  66,  46],\n",
       "       [145,  39,  18],\n",
       "       [ 85,  66,  41],\n",
       "       [ 30,  90,  66],\n",
       "       [115,  55, 100],\n",
       "       [130, 121,  84],\n",
       "       [ 38,  85,  26],\n",
       "       [117,  73,  96],\n",
       "       [114, 148,  75],\n",
       "       [150,   9, 127],\n",
       "       [ 68,  26, 102],\n",
       "       [ 20, 137,  96],\n",
       "       [ 36, 126,  24],\n",
       "       [ 95, 104,  26],\n",
       "       [111, 125,  61],\n",
       "       [ 53, 108, 101],\n",
       "       [ 71,  37,  66],\n",
       "       [ 83, 150, 107],\n",
       "       [ 56,  33, 101],\n",
       "       [ 92,  14,  79],\n",
       "       [ 11,  29,  76],\n",
       "       [ 42,  49,  62],\n",
       "       [135,  89, 135],\n",
       "       [ 10, 131,  70],\n",
       "       [ 49,   1,  20],\n",
       "       [133, 147,  97],\n",
       "       [123,  31,  20],\n",
       "       [ 33, 116,  98],\n",
       "       [ 85,  91, 130],\n",
       "       [  0,  63, 147],\n",
       "       [112,  76, 115],\n",
       "       [ 18,  82, 110],\n",
       "       [ 62,  67,  28],\n",
       "       [133,  45, 138],\n",
       "       [111, 107,  19],\n",
       "       [109,  54, 131],\n",
       "       [142,  10, 113],\n",
       "       [ 67,  14, 146],\n",
       "       [ 78, 133, 110],\n",
       "       [ 53, 103, 150],\n",
       "       [ 71,  15,  11],\n",
       "       [114,  12,  94],\n",
       "       [ 99,   4,  46],\n",
       "       [ 45,  86,  98],\n",
       "       [ 39,  18,  52],\n",
       "       [125,  99,  94],\n",
       "       [ 45,  69,  97],\n",
       "       [ 68, 145,  50],\n",
       "       [104,  25, 114],\n",
       "       [135,  30,  59],\n",
       "       [ 79, 109,  14],\n",
       "       [141,   3,  14],\n",
       "       [ 48,  36, 131],\n",
       "       [ 12,  79,  35],\n",
       "       [ 91,  92,   3],\n",
       "       [ 78,  70,  98],\n",
       "       [122, 108,  16],\n",
       "       [ 80,  15,  68],\n",
       "       [ 52, 150, 137],\n",
       "       [122, 101,  22],\n",
       "       [ 74,  14,  25],\n",
       "       [ 18,   0, 146],\n",
       "       [106, 125,  49],\n",
       "       [ 96,  16, 124],\n",
       "       [129,  95, 106],\n",
       "       [ 14,  67,  38],\n",
       "       [ 92,  31,  75],\n",
       "       [ 28,  23,  73],\n",
       "       [130,   7, 145],\n",
       "       [141,  99,  72],\n",
       "       [ 92,  74, 101],\n",
       "       [ 84,  60,  36],\n",
       "       [ 10,   7, 124],\n",
       "       [ 11,  28,  46],\n",
       "       [ 65,  32,  50],\n",
       "       [ 73,   0, 106],\n",
       "       [ 39,  66, 145],\n",
       "       [ 34,  37, 126],\n",
       "       [ 59, 120,  69],\n",
       "       [136,  26,  76],\n",
       "       [132,  87, 125],\n",
       "       [144, 108,  83],\n",
       "       [ 35,   9,  12],\n",
       "       [ 23, 100, 130],\n",
       "       [ 62, 112,  17],\n",
       "       [ 83,  94, 139],\n",
       "       [146,  44,  57],\n",
       "       [ 85,  55,  88],\n",
       "       [ 43,  97,  20],\n",
       "       [ 82,  11,  54],\n",
       "       [ 73,  74,  93],\n",
       "       [  3,  24,  38],\n",
       "       [150, 125,  29],\n",
       "       [122,  79, 131],\n",
       "       [ 24,  80, 100],\n",
       "       [ 28, 101,  80],\n",
       "       [ 19, 116,  74],\n",
       "       [102,  78,  47],\n",
       "       [ 38, 117,  27],\n",
       "       [ 70,  44,  55],\n",
       "       [108,  95,  74],\n",
       "       [116, 107, 117],\n",
       "       [  1, 141,  65],\n",
       "       [ 23, 139,   1],\n",
       "       [ 47, 110,  62],\n",
       "       [ 58,  33,  85],\n",
       "       [ 17,  65, 135],\n",
       "       [ 27,  11, 139],\n",
       "       [ 26,  61,  76],\n",
       "       [ 75, 128,  33],\n",
       "       [ 63,  89,  49],\n",
       "       [105,  82,  39],\n",
       "       [ 51,  33, 101],\n",
       "       [ 36,  91, 134],\n",
       "       [ 25,   5,  11],\n",
       "       [ 34, 136,  41],\n",
       "       [ 95,  80,  95],\n",
       "       [ 51,   9,   4],\n",
       "       [142, 101,  47],\n",
       "       [131,   9,  69],\n",
       "       [104,  28, 106],\n",
       "       [ 12,  64,  66],\n",
       "       [ 58, 111,  88],\n",
       "       [  4,   9,  69],\n",
       "       [141,   7,  41],\n",
       "       [ 95, 120,  12],\n",
       "       [137, 114, 110],\n",
       "       [ 93,  28,  81],\n",
       "       [118,  48,  36],\n",
       "       [ 70, 129, 137],\n",
       "       [ 85,  93,   3],\n",
       "       [ 37,  99, 146],\n",
       "       [109,  33,  71],\n",
       "       [136,  33,  79],\n",
       "       [ 51, 149, 125],\n",
       "       [ 26,   1,  69],\n",
       "       [101,  39,  31],\n",
       "       [ 36,  59,   8],\n",
       "       [136,   6, 111],\n",
       "       [133,  45, 126],\n",
       "       [ 70,  95,  79],\n",
       "       [ 57,  17,  57],\n",
       "       [129,  96,  91],\n",
       "       [ 14,   8,  18],\n",
       "       [ 56,  69, 105],\n",
       "       [101,  30,  70],\n",
       "       [ 77, 123, 149],\n",
       "       [150, 103,  90],\n",
       "       [ 11, 101, 133],\n",
       "       [ 37,  17, 149],\n",
       "       [112,  59, 145],\n",
       "       [ 35, 112,  56],\n",
       "       [140, 149,  81],\n",
       "       [ 60, 144,  36],\n",
       "       [ 36,  42,  96],\n",
       "       [136, 109,   8],\n",
       "       [106,  58,  49],\n",
       "       [118, 127,  12]])"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = np.vstack((a[0],a[1],a[2],a[3],a[4],a[5]))\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "5f815924",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0]])"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 0为女生，1为男生\n",
    "sex = np.random.randint(0,2,size = (300,1))\n",
    "sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "3c3a8bf0",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5,  18,  21,   0],\n",
       "       [ 41,  20, 129,   1],\n",
       "       [  3,  35,  12,   1],\n",
       "       ...,\n",
       "       [136, 109,   8,   0],\n",
       "       [106,  58,  49,   1],\n",
       "       [118, 127,  12,   0]])"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.concatenate((score,sex),axis = 1)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "f3b496c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([150, 150, 149])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([70.29, 74.6 , 71.98])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([70., 82., 69.])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([42.76, 45.38, 42.62])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 女生\n",
    "cond = data[:,3] == 0\n",
    "min = data[cond].min(axis = 0)[0:3]           #最小值\n",
    "max = data[cond].max(axis = 0)[0:3]           #最大值\n",
    "avg = data[cond].mean(axis = 0)[0:3].round(2) #平均值\n",
    "med = np.median(data[cond],axis = 0)[0:3].round(2) #中位数\n",
    "std = data[cond].std(axis = 0)[0:3].round(2)  #标准差\n",
    "display(min,max,avg,med,std)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "0532ec34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 0, 1])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([150, 150, 150])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([78.47, 67.04, 76.67])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([77. , 65.5, 75.5])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([44.24, 43.15, 41.17])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 男生\n",
    "cond1 = data[:,3] == 1\n",
    "min = data[cond1].min(axis = 0)[0:3]           #最小值\n",
    "max = data[cond1].max(axis = 0)[0:3]           #最大值\n",
    "avg = data[cond1].mean(axis = 0)[0:3].round(2) #平均值\n",
    "med = np.median(data[cond1],axis = 0)[0:3].round(2) #中位数\n",
    "std = data[cond1].std(axis = 0)[0:3].round(2)  #标准差\n",
    "display(min,max,avg,med,std)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9fbcea84",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
